<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(!Schema::HasTable('goods')){
            Schema::create('goods', function (Blueprint $table){
                $table->increments('id');
                $table->string('spname')->comments('商品名');
                $table->integer('sid')->comments('店铺id');
                $table->string('content')->comments('商品描述');
                $table->string('color')->comments('商品颜色');
                $table->string('shuxing')->comments('商品属性');
                $table->enum('hot',['0','1'])->default('0')->comments('0为正常,1为热销');
                $table->integer('branks_id');
                $table->integer('price');
                $table->integer('cate')->comments('类别id');
                $table->string('cover')->comments('商品相册封面');
                $table->integer('count')->comments('库存');
                $table->enum('status',['0','1'])->default('0')->comments('0为下架,1为上架');
                $table->timestamps();
            });
        }    

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        // Schema::drop('goods');

    }
}
